﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Abp.Domain.Entities;
using KelonProud.Domain.Entitys;

namespace KelonProud.TableManagement.Domain
{
    [Table("KpTableCategory")]
    public class TableCategory : Entity,IAuditEntity
    {
        [Column("Name"), StringLength(50)]
        public virtual string Name { get; set; }

        [Column("Code"), StringLength(10)]
        public virtual string Code { get; set; }

        [Column("Level")]
        public virtual int Level { get; set; }

        [Column("Order")]
        public virtual int Order { get; set; }

        [Column("ParentId")]
        public virtual int? ParentId { get; set; }

        [ForeignKey("ParentId")]
        public virtual TableCategory Parent { get; set; }

        [Column("Remark"), StringLength(255)]
        public virtual string Remark { get; set; }

        [Column("IdPath"), StringLength(100)]
        public virtual string IdPath { get; set; }

        [Column("NamePath"), StringLength(100)]
        public virtual string NamePath { get; set; }

        [ForeignKey("ParentId")]
        public virtual ICollection<TableCategory> Children { get; set; }
    }
}
